﻿using System;
using System.Collections.Generic;
using System.Text;

namespace formworks
{
    /// <summary>
    /// 用户请求服务基本接口
    /// service 前台数据的封装
    /// 使用business层的数据，
    /// 来封装成表现层需要的数据格式
    /// </summary>
    public interface IAction
    {
        /// <summary>
        /// 查询对象表中所有记录
        /// 接收数据：请求此方法即可
        /// 返回数据：json字符串
        /// </summary>
        /// <param name="request">前台http请求</param>
        /// <returns>json数据</returns>
        string Query(System.Web.HttpRequest request);

        /// <summary>
        /// 添加记录，可以接收多条记录
        /// 接收数据：json字符串
        /// 返回数据：{state:success,col:1} or {state:fail}
        /// </summary>
        /// <param name="request">前台http请求</param>
        /// <returns>{state:success,col:1} or {state:fail}</returns>
        string Add(System.Web.HttpRequest request);

        /// <summary>
        /// 修改操作，可修改多条
        /// 接收数据：json字符串
        /// 返回数据：{state:success,col:1} or {state:fail}
        /// </summary>
        /// <param name="request">前台http请求</param>
        /// <returns>{state:success,col:1} or {state:fail}</returns>
        string Modify(System.Web.HttpRequest request);

        /// <summary>
        /// 删除数据，以ID为标识
        /// 接收数据：数组字符串 例：id1,id3,id4
        /// 返回数据：{state:success,col:1} or {state:fail}
        /// </summary>
        /// <param name="request">前台http请求</param>
        /// <returns>{state:success,col:1} or {state:fail}</returns>
        string Remove(System.Web.HttpRequest request);

    }//end IAction
}//end namespace
